package com.sxhalo.fsms.quartz;

public enum DeviceAttrEnum {



	Ready(1,"Ready"),
	Running(2,"Running"),
	Start(3,"Start"),
	Alarm(4,"Alarm"),
	Trip(5,"Trip"),
	StartARunning(6,"StartARunning"),
	StartBRunning(7,"StartBRunning"),
	OverloadAlarm(8,"OverloadAlarm"),
	StallAlarm(9,"StallAlarm"),
	BlockAlarm(10,"BlockAlarm"),
	PhaseFailureAlarm(11,"PhaseFailureAlarm"),
	NegativePhaseAlarm(12,"NegativePhaseAlarm"),
	CurrentUnbalanceAlarm(13,"CurrentUnbalanceAlarm"),
	ExternalFaultAlarm(14,"ExternalFaultAlarm"),
	PTCOverheatingAlarm(15,"PTCOverheatingAlarm"),
	OvervoltageAlarm(16,"OvervoltageAlarm"),
	UndervoltageAlarm(17,"UndervoltageAlarm"),
	OverpowerAlarm(18,"OverpowerAlarm"),
	UnderpowerAlarm(19,"UnderpowerAlarm"),
	OverloadTrip(20,"OverloadTrip"),
	StallTrip(21,"StallTrip"),
	BlockTrip(22,"BlockTrip"),
	PhaseFailureTrip(23,"PhaseFailureTrip"),
	NegativePhaseTrip(24,"NegativePhaseTrip"),
	CurrentUnbalanceTrip(25,"CurrentUnbalanceTrip"),
	ExternalFaultTrip(26,"ExternalFaultTrip"),
	PTCOverheatingTrip(27,"PTCOverheatingTrip"),
	OvervoltageTrip(28,"OvervoltageTrip"),
	UndervoltageTrip(29,"UndervoltageTrip"),
	OverpowerTrip(30,"OverpowerTrip"),
	UnderpowerTrip(31,"UnderpowerTrip"),
	PhaseACurrent(32,"PhaseACurrent"),
	PhaseBCurrent(33,"PhaseBCurrent"),
	PhaseCCurrent(34,"PhaseCCurrent"),
	UabLineVoltage(35,"UabLineVoltage"),
	UbcLineVoltage(36,"UbcLineVoltage"),
	UcaLineVoltage(37,"UcaLineVoltage"),
	ActivePower(38,"ActivePower"),
	ReactivePower(39,"ReactivePower"),
	ApparentPower(40,"ApparentPower"),
	PowerFactor(41,"PowerFactor"),
	CurrentUnbalance(42,"CurrentUnbalance"),
	HeatCapacityPercentage(43,"HeatCapacityPercentage"),
	TotalStart(44,"TotalStart"),
	TotalTrip(45,"TotalTrip"),
	TotalRuningHour(46,"TotalRuningHour"),
	CurrentRuningHour(47,"CurrentRuningHour"),
	Online(48,"Online"),
	LatestMaintenanceTime(49,"LatestMaintenanceTime"),
	OperatingFrequency(50,"OperatingFrequency"),
	SetFrequency(51,"SetFrequency"),
	BusVoltage(52,"BusVoltage"),
	OutputVoltage(53,"OutputVoltage"),
	OutputCurrent(54,"OutputCurrent"),
	OperatingSpeed(55,"OperatingSpeed"),
	OutputTorque(56,"OutputTorque"),
	OutputPower(57,"OutputPower"),
	ClosedLoopSet(58,"ClosedLoopSet"),
	ClosedLoopFeedback(59,"ClosedLoopFeedback"),
	ReadCurrentSegmentnum(60,"ReadCurrentSegmentnum"),
	ExternalLengthValue(61,"ExternalLengthValue"),
	ExternalCountValue(62,"ExternalCountValue"),
	TorqueSetValue(63,"TorqueSetValue");





	/**
	 * 变量
	 */
	private final int code;

	/**
	 * 报警来源信息
	 */
	private final String msg;

	public Integer getCode() {
		return code;
	}

	public String getMsg() {
		return msg;
	}

	DeviceAttrEnum(Integer code, String msg) {
		this.code = code;
		this.msg = msg;
	}

	/**
	 * 获取某个枚举
	 * @param key
	 * @return
	 */
	public static DeviceAttrEnum getEnumByKey(int key){
		for (DeviceAttrEnum e: DeviceAttrEnum.values()){
			if(e.getCode()==key){
				return e;
			}
		}
		return null;
	}

}
